home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 016a / crontb22.zip / CRONTAB.DOC < prev    next >
Text File  |  1991-07-22  |  14KB  |  334 lines

  1.  
  2.  
  3.                           CRONTAB - 2.2
  4.                           Documentation
  5.  
  6.    Copyright 1990-1991, Thomas G. Harold, All Rights Reserved.
  7.  
  8.  
  9.     CRONTAB is a program that will run programs based on the 
  10. date.  Execution can be periodic such as daily, weekly, monthly, 
  11. or yearly with or without a specified offset such as the third 
  12. day of the month.  Execution can also be day-specific such as 
  13. every Monday, Wednesday, Friday, or on the 15th of each month.  
  14. If it has to be done periodically, then CRONTAB is the program to 
  15. do it.
  16.  
  17. -----------------------------------------------------------------
  18.  
  19.                            INSTALLATION
  20.                            ------------
  21.  
  22.     Installation of CRONTAB is fairly simple.  CRONTAB.EXE should 
  23. be placed into a directory in your path (such as C:\BIN), and
  24. CRONTAB.DAT should be placed into any convenient directory (e.g. 
  25. C:\BIN\CRONTAB).  After installing these two files, see the 
  26. USAGE NOTES section for information on configuring CRONTAB for 
  27. your system.
  28.  
  29.     CRONTAB uses two data files.  CRONTAB.DAT is the main data 
  30. file and contains a list of things for CRONTAB to do.  The second 
  31. file, CRONTAB.REC, is created and maintained by CRONTAB and 
  32. should not be tampered with unless you want CRONTAB to forget 
  33. what it was doing.  CRONTAB assumes that it will find these two 
  34. files in the directory where it is started from, and will not 
  35. look anywhere else.
  36.  
  37.     The basic operation of CRONTAB is quite simple.  To operate, 
  38. you must change directories so that your current directory is the 
  39. directory containing CRONTAB.DAT.  Then, to start CRONTAB, just 
  40. issue the command CRONTAB and press enter.  CRONTAB will look for 
  41. and read CRONTAB.REC if it exists, otherwise it will create it, 
  42. then CRONTAB will proceed to process the CRONTAB.DAT file.  After 
  43. CRONTAB is finished, it will update its CRONTAB.REC file and 
  44. exit.
  45.  
  46.     CRONTAB can also be run in quiet mode.  This is accomplished
  47. by using "CRONTAB -Q" when running CRONTAB.
  48.  
  49. -----------------------------------------------------------------
  50.  
  51.  
  52.                            USAGE NOTES
  53.                            -----------
  54.  
  55. INTRODUCTION
  56. ------------------------------
  57.  
  58.     The data file, CRONTAB.DAT, is the file that directs CRONTAB.  
  59. It consists of codes and command-lines that will tell CRONTAB 
  60. when and which programs to execute.  Each line in the file is 
  61. made up of a three letter code optionally followed by a sub-code 
  62. and arguments, and a command-line which is set off by a comma.  
  63. For example:
  64.  
  65.         XXXYNN NN NN     ,C:\DOS\CHKDSK /F
  66.  
  67.     "XXX" is the three letter code which defines the basic 
  68. command class.  Codes are not case-sensitive.  Currently this 
  69. code can be one of the following classes: 
  70.  
  71.         AWS     "Always"
  72.         PER     "Periodic"
  73.         DOP     "Day-Of-Period"
  74.  
  75.     "Y" is the optional one letter code which defines the sub-
  76. class for a command.  Currently this code can be one of the 
  77. following:
  78.  
  79.         D       "Daily"
  80.         W       "Weekly"
  81.         M       "Monthly"
  82.         Y       "Yearly"
  83.  
  84.     "NN NN NN" is the optional argument list for the command.  
  85. This is described in more detail later.
  86.     Finally, "C:\DOS\CHKDSK /F" is the command-line to be 
  87. executed.  Notice that it is separated from the command codes by 
  88. a comma.
  89.     Comments can be placed in the data file by using a semicolon 
  90. at the start of any line.  This provides a quick way of disabling 
  91. parts of the data file from being executed.
  92.  
  93.  
  94. "AWS" CODE
  95. ------------------------------
  96.  
  97.     The "AWS" code is short for "Always".  This code has no sub-
  98. codes or arguments and indicates that CRONTAB should always 
  99. execute its command-line.
  100.  
  101.  
  102. "PER" CODE
  103. ------------------------------
  104.  
  105.     The "PER" code is short for "Periodic" and indicates that 
  106. this command-line is to be executed on a periodic time interval.  
  107. "Periodic" codes are executed once per day at the most, and are 
  108. only executed once during their specified period. The difference 
  109. between "Periodic" codes and "Day-Of-Period" codes is that if 
  110. CRONTAB is not executed on the day that the period starts, then 
  111. the command will be executed the next time that CRONTAB is run.  
  112. For example, if the periodic code indicates that a backup should 
  113. be done on or after the 15th of the month and CRONTAB is not run 
  114. on the 15th, 16th or 17th of the month, then when CRONTAB is run 
  115. on the 18th, the backup will get done at that time.  But if 
  116. CRONTAB was run as planned on the 15th, then the backup would get 
  117. done on the 15th as planned.
  118.     There are four sub-codes used by "PER" codes.  They are the 
  119. "D" (Daily), "W" (Weekly, "M" (Monthly), and the "Y" (Yearly) 
  120. codes.  "PERD" (Periodic-Daily) codes get executed once per day, 
  121. every day of the year.  "PERW" codes get executed once per week.  
  122. "PERM" codes get executed once per month.  And "PERY" codes get 
  123. executed once per year.
  124.  
  125.     "PERD" codes take no arguments and simply indicate that the 
  126. command-line is to be executed once per day, every day of the 
  127. year.
  128.  
  129.     "PERW" codes take the form "PERWn", where "n" is the day of 
  130. the week to base the period on.  Sunday = 0, Monday = 1, and so 
  131. on through Saturday = 6.  If "n" is not given, then CRONTAB will 
  132. assume that Sunday was meant.
  133.  
  134.     "PERM" codes take the form "PERMnn", where "nn" is the day of 
  135. the month to base the period on.  For example, if the backup is 
  136. to be done on or after the 20th of the month, the code would be 
  137. "PERM20".  If the code indicates a day that is too high for the 
  138. current month, (e.g. 30 in February), the code will be executed 
  139. on the last day of the month.  (In February of a non-leap year, 
  140. all PERM29, PERM30, & PERM31 codes would be executed on the same 
  141. day as the PERM28 code.)  If "nn" is not given, CRONTAB will 
  142. assume that the first of the month is meant.
  143.  
  144.     "PERY" codes take the form "PERYn/nn", where "n/nn" is the 
  145. month/day of the year to base the code on.  If "n/nn" is not 
  146. given, then CRONTAB will assume that the first of January was 
  147. meant.  "PERY" codes could possibly be used in a group to execute 
  148. a file every three months.  This would be accomplished by the 
  149. following which would call TRIMONTH.BAT. (This technique could 
  150. also be used with PERM & PERW codes.):
  151.  
  152. ; Example of a batch file which is to be called every 3 months.
  153. PERY01/01,TRIMONTH
  154. PERY04/01,TRIMONTH
  155. PERY07/01,TRIMONTH
  156. PERY10/01,TRIMONTH
  157.  
  158.  
  159. "DOP" CODE
  160. ------------------------------
  161.  
  162.     The "DOP" code is a mnemonic for "Day-Of-Period" and tells 
  163. CRONTAB that this command-line is to be executed on certain days 
  164. in a given time interval.  "Day-Of-Period" codes, like "PER" 
  165. codes, are only executed once on the day specified.  "DOP" codes 
  166. could be used to run programs on a Monday, Wednesday, Friday 
  167. schedule, on the 1st, 3rd, and 10th of each month, or any other 
  168. way that you need.
  169.     There are three sub-codes used by "DOP" codes.  They are the 
  170. "W" (Weekly), "M" (Monthly), and the "Y" (Yearly) codes.  "DOPW" 
  171. (Day-Of-Period-Weekly) codes get executed on certain days of the 
  172. week.  "DOPM" codes are executed on certain days of the month.  
  173. And "DOPY" codes can be executed on a certain day of the year.  
  174. (Such as the day before your friend's birthday, to remind you to 
  175. get a card and present.)  All "DOP" codes require one or more 
  176. arguments to function correctly.
  177.  
  178.     "DOPW" codes take the format "DOPWnnnn", where "nnnn" is one 
  179. or more days of the week that the command should be executed on.  
  180. This consists of numbers between 0 (Sunday) and 6 (Saturday) and 
  181. can contain any combination thereof.  (e.g. "135" for Monday, 
  182. Wednesday, and Friday.)  
  183.  
  184.     "DOPM" codes take the form "DOPMnn nn nn nn...", where "nn nn 
  185. nn..." consists of one or more days of the month to execute on.  
  186. For example, a code of "DOPM15 30" would execute on the 15th and 
  187. 30th of the month.  If a month is shorter than a given argument, 
  188. (e.g. "30" in February), then the command will execute on the 
  189. last possible day of the month.  On February 28th of a non-leap 
  190. year, the codes "DOPM28", "DOPM29", "DOPM30" and "DOPM31" would 
  191. all execute on the same day.
  192.  
  193.     "DOPY" codes take the form "DOPYm/dd" where "m" is the month, 
  194. and "dd" is the day of the month.  "DOPY" codes handle February 
  195. 29th differently then "DOPM" codes.  If you specify "DOPY2/29" to 
  196. be executed, it will not be executed except on February 29th of 
  197. a leap year.
  198.  
  199.  
  200. SAMPLE CRONTAB.DAT FILE
  201. ------------------------------
  202.  
  203. ;
  204. ; Sample CRONTAB.DAT file
  205. ;   (Extracted from the CRONTAB.DAT that comes with CRONTAB)
  206. ;
  207. ;   Note that capitalization of the codes does not make a 
  208. ;   difference.  Nor does spacing.  Both are merely used for
  209. ;   clarity and ease of understanding.
  210. ;
  211. AWS             ,echo Hello world, I am always executed
  212.  
  213. PErD        ,echo This is a daily comment!
  214. Perw,echo You'll see me at the start of each week!
  215. PERW0      ,echo I'm weekly starting Sunday...
  216. PERW1                      ,echo I'm weekly starting Monday...
  217. pERW2           ,echo I'm weekly starting Tuesday...
  218. PERW3           ,echo I'm weekly starting Wednesday...
  219. perw4           ,echo I'm weekly starting Thursday...
  220. PErw5           ,echo I'm weekly starting Friday...
  221. perw6           ,echo I'm weekly starting Saturday...
  222.  
  223. PERM            ,echo Default monthly.
  224. PERM5           ,echo This is on or after the 5th, isn't it?
  225. PeRM20          ,echo It is now past the twentieth of the month.  Time to pay bills!
  226.  
  227. PERY            ,echo I do things at the beginning of the year.
  228. PERY3/30        ,echo I make sure that you remember that March 30th has passed.
  229. PERY12/31       ,echo Another year down the drain...
  230.  
  231. PERY01/01       ,echo This is the 1st of 4 executions per year.
  232. PERY04/01       ,echo This is the 2nd of 4 executions per year.
  233. PERY07/01       ,echo This is the 3rd of 4 executions per year.
  234. PERY10/01       ,echo This is the 4th of 4 executions per year.
  235.  
  236. DOPW2           ,echo Today is Tuesday
  237. DOPW3           ,echo Today is Wednesday
  238. DOPW0           ,echo Today is Sunday
  239. DOPW1           ,echo Today is Monday
  240. DOPW4           ,echo Today is Thursday
  241. DOPW6           ,echo Today is Saturday
  242. DOPW5           ,echo Today is Friday
  243. DOPW135         ,echo Today is either Monday, Wednesday, or Friday
  244. DOPW0246        ,echo Today is either Sunday, Tuesday, Thursday, or Saturday
  245.  
  246. DOPM1           ,echo Today is the 1st of the month
  247. DOPM1 5 10      ,echo Today is either the 1st, 5th, or 10th of the month.
  248. DOPM20 31       ,echo Today is either the 20th or the last day of the month.
  249. DOPM29          ,echo Today is the 29th (or last day if it's February).
  250. DOPm28          ,echo Today is the 28th.
  251. dopm30          ,echo Today is the 30th, (or the last day if it's February).
  252. DopM31          ,echo Today is the last day in the month.
  253.  
  254. DOPY1/1         ,echo Happy new year!
  255. dopY3/30        ,echo Today is March 30th!
  256. DoPY12/25       ,echo Merry Christmas!
  257.  
  258. ;   **************************
  259. ;   *  End of sample file    *
  260. ;   **************************
  261.  
  262. -----------------------------------------------------------------
  263.  
  264.  
  265.                             CONCLUSION
  266.                             ----------
  267.  
  268.     Please let me know if you have any suggestions for CRONTAB.
  269.     If you have any questions that aren't answered in the 
  270. documentation file or sample CRONTAB.DAT file, than drop me a 
  271. note via U.S. Mail or Compuserve MAIL.
  272.  
  273. -----------------------------------------------------------------
  274.  
  275. History:
  276.  
  277.         1.0     Fall 1989
  278.             Original release version that never really got 
  279.             released.
  280.  
  281.         2.0     December 1990
  282.             Newer, better, faster version.  Now it doesn't look
  283.             like a snail crawling across a runway.
  284.  
  285.         2.1     January 1991
  286.             Fixed bug with PERY & DOPY codes.  
  287.  
  288.         2.2     July 1991
  289.             Added 'quiet' switch ("CRONTAB -Q")
  290.  
  291. -----------------------------------------------------------------
  292.  
  293.     Usage of CRONTAB is free to individuals using it for 
  294. personal/private use.  In vogue with the current trend I ask that 
  295. if you really feel the need to send money to someone then make a 
  296. donation to charity.  Educational institutions are also granted 
  297. free usage.  I do ask that if CRONTAB is to be used by an 
  298. educational institution that I be notified for informational 
  299. purposes.  Use in a business environment requires a site licence. 
  300. (Contact me for information on site licensing.)  
  301.  
  302.                             DISCLAIMER
  303.     This program is distributed "as is".  I disclaim all 
  304.     warranties, expressed or implied, including, without 
  305.     limitation, the warranties of merchantability and of 
  306.     fitness for any purpose.  I will assume no liability for 
  307.     damages, direct or consequential, which may result from 
  308.     the use of this program. 
  309.  
  310.     Feel free to distribute this program so long as no money 
  311. changes hands except for media/connect-time costs.  Once again, I 
  312. ask that if this program is distributed by any mail-order 
  313. distribution company that I be notified. 
  314.     Modifications may not be made to CRONTAB except for 
  315. personal/private use.  Modified copies may not be distributed in 
  316. any form.
  317.  
  318. -----------------------------------------------------------------
  319.  
  320. Please contact me if you have any suggestions or questions about 
  321. the program.  I can be reached at the following address: 
  322.  
  323.         Thomas G. Harold
  324.         2206 Tracey's Rd.
  325.         Sparks, MD. 21152
  326.  
  327. Or by using Compuserve MAIL:
  328.  
  329.         Thomas G. Harold - 71750,3724
  330.  
  331. Please place the word "CRONTAB" where I can easily see it, 
  332. (e.g. in the subject field, or on the address label).  This will 
  333. help me to more easily attend to your correspondence.
  334.